home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / polyed.lha / PolyEd / Install < prev    next >
Encoding:
Text File  |  1995-01-28  |  8.0 KB  |  355 lines

  1. ; $VER: Install 1.394 (28-01-1994)
  2. ; Script to install PolyEd
  3.  
  4. (complete 0)
  5.  
  6. ;=============================================================================
  7. ; strings
  8.  
  9. (set #bad-kick
  10. (cat "You must be using Kickstart 2.0 or higher to install PolyEd."
  11. ))
  12.  
  13. (set #introduction
  14. (cat "\n\nThis program lets you install PolyEd on a hard drive (or where-ever you want)."
  15. ))
  16.  
  17. (set #which-language
  18. (cat "\nWhich languages should be installed?"
  19. ))
  20.  
  21. (set #which-iconset
  22. (cat "\nWhich icon set should be installed?"
  23. ))
  24.  
  25.  
  26. (set #which-language-help
  27. (cat "\nThe Amiga can be operated in many different "
  28.      "languages. "
  29.      "To reduce the amount of space consumed by the "
  30.      "language files, you can select only the "
  31.      "files of specific languages to be copied.\n\n"
  32.      "Check the boxes of the languages you wish "
  33.      "to have available on your system.\n\n"
  34.      @askoptions-help
  35. ))
  36.  
  37. (set #which-iconset-help
  38. (cat "\nThis package provides two sets of icons, one for standard workbench and "
  39.      "one for the 'MagicWB'. Select the set you want to use.\n"
  40.      @askchoice-help
  41. ))
  42.  
  43. (set #startup-help
  44. (cat "\nAn assign to the PolyEd drawer called PED: "
  45.      "and the inclusion of that assign to the "
  46.      "paths where AmigaOS looks for programs is "
  47.      "being added to the user-startup"
  48. ))
  49.  
  50. (set #pretend-iconcopy
  51. (cat "\nNow I would copy icons of the selected set "
  52.      "for all files in the Doc, Rexx and Macro drawers."
  53. ))
  54.  
  55. ;=============================================================================
  56. ; make sure we are running under V37+
  57.  
  58. (set osversion (/ (getversion) 65536))
  59. (if (< osversion 37)
  60. (
  61.     (abort #bad-kick)
  62. ))
  63.  
  64. ;=============================================================================
  65. ; say hi!
  66.  
  67. ;(set old_level @user-level)    ; remember user-level
  68. ;(user 2)                    ; for message is shown
  69. ;(message #introduction)        ; show intro message
  70.  
  71. ;(user old_level)            ; revert to original user-level
  72.  
  73. ;(welcome)
  74.  
  75. ;=============================================================================
  76. ; get target
  77.  
  78. (set old_level @user-level)    ; remember user-level
  79. (user 2)
  80.  
  81. (set target (askdir (prompt "Where do you want the PolyEd drawer to be placed in?")
  82.             (help @askdir-help)
  83.             (default "SYS:Tools")
  84.         )
  85. )
  86. (user old_level)
  87. (set @default-dest target)
  88.  
  89. ;=============================================================================
  90. ; which languages should be installed?
  91.  
  92. (user 2)
  93. (set lang (askoptions (prompt #which-language)
  94.               (help #which-language-help)
  95.               (choices
  96. ;                    "Dansk"
  97.                     "Deutsch"
  98.                     "English"
  99. ;                    "Español"
  100. ;                    "Français"
  101. ;                    "Italiano"
  102. ;                    "Nederlands"
  103. ;                    "Norsk"
  104. ;                    "Português"
  105.                     "Svenska"
  106.                 )
  107.               (default -1)
  108.       )
  109. )
  110. (user old_level)
  111.  
  112. ;=============================================================================
  113. ; which icon set should be installed (Standard or MagicWB)
  114.  
  115. (set iconset (askchoice (prompt #which-iconset)
  116.                         (help #which-iconset-help)
  117.                         (choices "Standard" "MagicWB")
  118.             )
  119. )
  120.  
  121. ;=============================================================================
  122. ; Copy required libraries for V37
  123.  
  124. (if (= osversion 37)
  125. (
  126.     (working "Installing libraries to Libs:")
  127.     (copylib
  128.         (help #v37needslibs)
  129.         (source "reqtools.library")
  130.         (dest "LIBS:")
  131.     )
  132.  
  133.     (copylib
  134.         (help #v37needslibs)
  135.         (source "amigaguide.library")
  136.         (dest "LIBS:")
  137.     )
  138. ))
  139. (complete 10)
  140. ;=============================================================================
  141. ; make some drawers
  142.  
  143. (set supertarget target)
  144. (set target (tackon target "PolyEd"))
  145. (makedir target (infos) (prompt "Creating some drawers..."))
  146. (makedir (tackon target "Doc"))
  147. (makedir (tackon target "Icons"))
  148.  
  149. ;=============================================================================
  150. ; copy main-program
  151.  
  152. (copyfiles (prompt "")
  153.        (help @copyfiles-help)
  154.        (source "ped")
  155.        (dest target)
  156. )
  157. (complete 40)
  158.  
  159. (copyfiles (prompt "")
  160.        (help @copyfiles-help)
  161.        (source "Read.Me")
  162.        (dest target)
  163. )
  164. (complete 45)
  165.  
  166. ;=============================================================================
  167. ; copy catalogs and documentation
  168. (working "Installing Documentation and catalogs")
  169. (copyfiles (optional nofail)
  170.              (source "Doc")
  171.               (dest (tackon target "Doc"))
  172.            (pattern "arexx.#?")
  173. )
  174.  
  175. (set n 0)
  176. (while (set language (select n
  177. ;                    "Dansk"
  178.                     "Deutsch"
  179.                     "English"
  180. ;                    "Español"
  181. ;                    "Français"
  182. ;                    "Italiano"
  183. ;                    "Nederlands"
  184. ;                    "Norsk"
  185. ;                    "Português"
  186.                     "Svenska"
  187.                     ""
  188.              )
  189.        )
  190. (
  191.     (if (IN lang n)
  192.     (
  193.         (if (<> 1 n)    ; FIXME: Wenn Dansk verfügbar, 1 auf 2 ändern (entspricht englisch, das als Default keinen Catalog hat!)
  194.         (
  195.             (makedir (tackon target "Catalogs"))
  196.             (set catalog-dir (tackon target (cat "Catalogs/" language )))
  197.             (makedir catalog-dir)
  198.             (copyfiles
  199.                 (optional nofail)
  200.                 (source (cat "Catalogs/" language "/polyed.catalog"))
  201.                    (dest catalog-dir)
  202.             )
  203.         ))
  204.         (set #from (cat "Doc/" language ".guide"))
  205.         (if (exists #from)
  206.             (copyfiles
  207.                 (optional nofail)
  208.                 (source #from)
  209.                 (dest (tackon target "Doc"))
  210.             )
  211.         )
  212.     ))
  213.     (set n (+ n 1))
  214. ))
  215.  
  216. (complete 50)
  217.  
  218. ;=============================================================================
  219. ; copy Macros and ARexx
  220. (working "Installing Macros and Arexx scripts")
  221. (copyfiles
  222.     (source "Macros")
  223.     (dest (tackon target "Macros"))
  224.     (optional nofail)
  225.     (pattern "~#?.info")
  226. )
  227. (complete 60)
  228.  
  229. (copyfiles
  230.     (source "Rexx")
  231.     (dest (tackon target "Rexx"))
  232.     (optional nofail)
  233.     (pattern "~#?.info")
  234. )
  235. (complete 70)
  236.  
  237. ;=============================================================================
  238. ; copy Icons
  239.  
  240. (if @pretend
  241. (working #pretend-iconcopy)
  242. (
  243.     (working "Installing icons")
  244.     (if (= iconset 0)
  245.         (set iconsource "Icons/Standard")
  246.         (set iconsource "Icons/MagicWB")
  247.     )
  248.  
  249.     ; PolyEd Drawer
  250.  
  251.     (copyfiles (source (cat iconsource ".info"))
  252.            (dest supertarget)
  253.            (newname "PolyEd.info")
  254.            (infos)
  255.            (nogauge)
  256.     )
  257.  
  258.     ; Main Program and Subdrawers
  259.  
  260.     (set n 0)
  261.     (while (set from (select n "PEd.info" "Read.Me.info" "Doc.info" "Macros.info" "Rexx.info" "Icons.info" ""))
  262.         (copyfiles  (source (tackon iconsource from))
  263.                     (dest target)
  264.                     (infos)
  265.                      (nogauge)
  266.         )
  267.         (set n (+ n 1))
  268.     )
  269.  
  270.     ; Docs
  271.     (set destdir (tackon target "Doc"))
  272.     (foreach destdir "#?.guide"
  273.     (
  274.         (copyfiles  (source (tackon iconsource "def_guide.info"))
  275.                     (dest destdir)
  276.                     (newname (cat @each-name ".info"))
  277.                       (infos)
  278.                     (nogauge)
  279.         )
  280.     ))
  281.     (foreach destdir "#?.doc"
  282.     (
  283.         (copyfiles  (source (tackon iconsource "def_doc.info"))
  284.                     (dest destdir)
  285.                     (newname (cat @each-name ".info"))
  286.                     (infos)
  287.                        (nogauge)
  288.         )
  289.     ))
  290.  
  291.     ; Rexx
  292.     (set destdir (tackon target "Rexx"))
  293.     (foreach destdir "#?.rexx"
  294.     (
  295.         (copyfiles  (source (tackon iconsource "def_rexx.info"))
  296.                     (dest destdir)
  297.                     (newname (cat @each-name ".info"))
  298.                     (infos)
  299.                     (nogauge)
  300.         )
  301.     ))
  302.  
  303.     ; Macros
  304.     (set destdir (tackon target "Macros"))
  305.     (foreach destdir "#?.ped"
  306.     (
  307.         (copyfiles  (source (tackon iconsource "def_ped.info"))
  308.                     (dest destdir)
  309.                     (newname (cat @each-name ".info"))
  310.                     (infos)
  311.                     (nogauge)
  312.         )
  313.     ))
  314.  
  315. ;------------------------------------------------------------
  316. ; Copy only icons of selected set
  317. ; FIXME: Should make an option to install icons only...
  318. ;------------------------------------------------------------
  319.  
  320.     (copyfiles     (source iconsource)
  321.                 (dest (tackon target "Icons"))
  322.                 (infos)
  323.                 (optional nofail)
  324.                 (pattern "def_#?.info")
  325.                 (nogauge)
  326.     )
  327. ))
  328.  
  329. (complete 90)
  330.  
  331. ;------------------------------------------------------------
  332. ; Copy keyfile for registrated users
  333. ;------------------------------------------------------------
  334.  
  335. (if (exists "ped.key")
  336.     (copyfiles     (source "ped.key")
  337.                 (dest target)
  338.                 (optional nofail)
  339.                 (infos)
  340.                 (help @copyfiles-help)
  341.     )
  342. )
  343.  
  344. ;=============================================================================
  345. ; Make user-startup entries
  346.  
  347. (startup "PolyEd"
  348.     (prompt    "Some instructions need to be added to the \"S:user-startup\" so that your system will be properly configured to use PolyEd.")
  349.     (help #startup-help)
  350.     (command (cat "assign >NIL: PED: " target "\n"))
  351.     (command "path >NIL: PED: add")
  352. )
  353.  
  354. (complete 100)
  355.